import request from '@/utils/request'
// 获取对应树结构
export function getDepartTree() {
  return request({
    url: '/business-hall/tree'
  })
}

// 获取机构详情
export function getDepartDetail(id) {
  return request({
    url: `/business-hall/${id}`
  })
}

// 根据机构id获取用户列表
export function getUserListByDepartId(params) {
  return request({
    url: `/business-hall/user/page`,
    params
  })
}
// 获取城市列表
export function getCityList(params) {
  return request({
    url: `/areas/children`,
    params
  })
}
// 编辑机构 接口不对
export function saveDepart(data) {
  return request({
    url: '/business-hall',
    method: 'post',
    data
  })
}
// 网点范围
export function workScope({ id, type }) {
  return request({
    url: `/business-hall/scope/${id}/${type}`
  })
}
// 保存网点范围
export function saveOutletsScope(data) {
  return request({
    url: '/business-hall/scope',
    method: 'post',
    data
  })
}
// 删除网点范围
export function delOutletsScope({ id, type }) {
  return request({
    url: `/business-hall/scope/${id}/${type}`
  })
}
// 运费管理(获取数据)
export function TransitList() {
  return request({
    url: '/carriages'
  })
}
// 运费管理添加/ 修改数据
export function addOrModifyTransit(data) {
  return request({
    url: '/carriages',
    method: 'post',
    data
  })
}
// 删除模板
export function delTransit(id) {
  return request({
    url: '/carriages/' + id,
    method: 'delete'
  })
}

